<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>hello
        <p>p1</p>
        <p>p2</p>
        <p>p3</p>
        <p>p4</p>
    </div>

    <div>
        <div>box1</div>
        <div>box2</div>
        <div>box3</div>
        <div>box4</div>
    </div>
    <script>
        const nodes = document.documentElement.childNodes;

        // document.head
        console.log(nodes[0]);
        console.log(nodes[2]);
        // document.body

        console.log(document.documentElement.firstChild);
        console.log(document.documentElement.lastChild);



    </script>
</body>

</html>